<%-- 
    Document   : chitietbaihoc
    Created on : Jul 9, 2013, 4:39:13 PM
    Author     : USERT
--%>

<%@page contentType="text/html" pageEncoding="UTF-8"%>

<%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib uri="http://java.sun.com/jsp/jstl/xml" prefix="x" %>



<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <link href="css/DetailedLesson.css" rel="stylesheet" type="text/css" media="all"/>

        <script type="text/javascript" src="javascript/DetailedLesson.js"></script>
        <title>Chi tiết bài học</title>
    </head>
    <body onload="change('tab1')" class="">
        <c:set var="account" value="${sessionScope.ACCOUNT}"/>
        <c:set var="lessonId" value="${param.lessonId}"/>
        <c:set var="detailType" value="${param.detailType}"/>
        <c:if test="${empty param.detailType}">
            <c:set var="detailType" value="0"/>
        </c:if>
        
       

        <c:import url="xml/LessonLists.xml" var="LessonListsXML" charEncoding="UTF-8"/>
        <c:import url="xml/DetailedLessons.xml" var="DetailedXML" charEncoding="UTF-8"/>
        <c:import url="xsl/DetailedLesson_user.xsl" var="DetailedXSL" charEncoding="UTF-8"/>
        <c:import url="xsl/DetailedLesson_admin.xsl" var="DetailedXSL_admin" charEncoding="UTF-8"/>
        <x:parse var="lessonlistdoc" xml="${LessonListsXML}"/>



        <div style="margin: auto; width: 990px;">
            <div class="header">
                <c:import url="header.jsp"/>
            </div>
            <div class="content">
                <div class="content_left">
                    <c:choose>
                        <c:when test="${not empty USERNAME}">
                            <c:import url="login-success.jsp">
                                <c:param name="user" value="${USERNAME}"/>
                            </c:import>
                        </c:when>
                        <c:otherwise>
                            <c:import url="loginBox.jsp"/>
                        </c:otherwise>
                    </c:choose>
                </div>
                <div class="content_right">
                    <!--toi them doan code if account chua test -->
                    <c:if test="${account == 'user'}">
                    <c:if test="${not empty lessonId}">                
                    <x:transform  xml="${DetailedXML}" xslt="${DetailedXSL}" >
                        <x:param name="lessonlist" value="xml/LessonLists.xml"/>
                        <x:param name="lId" value="${lessonId}"/>
                        <x:param name="type" value="${detailType}"/>
                    </x:transform>
                    </c:if>
                   </c:if>
                    <c:if test="${account=='admin'}">
                       <c:if test="${not empty lessonId}">
                        <x:transform  xml="${DetailedXML}" xslt="${DetailedXSL_admin}" >
                            <x:param name="lessonlist" value="xml/LessonLists.xml"/>
                            <x:param name="lId" value="${lessonId}"/>
                            <x:param name="type" value="${detailType}"/>

                        </x:transform>
                    </c:if>
                    </c:if>
                    <c:if test="${empty account}">
                        <h3>Bạn vui lòng đăng nhập để xem nội dung!</h3>
                    </c:if>
                </div>
            </div>
        </div>
        <div class="foot-wrap">
            Assignment - Group Điền Nam Ngọc<br/>
            FPT - University
        </div>
            

    </body>
</html>
